﻿using ACC.Business;
using ACC.Business.Stn;
using ACC.Data.Comm;
using ACC.Data.Line;
using ACC.Device;
using ACC.Device.PLC.Siemens;
using System;
using System.Text;

namespace Script
{
    /// <summary>
    /// 电芯排废，无用
    /// OP L1M01070, STATION L1M11071, L1M21071
    /// </summary>
    public class L1M01070 : StnProcessPL02_JT
    {
        public L1M01070(StnRunningData data)
            : base(data)
        {
            IsReport = false;
            IsACCReport = false;
            IsPalletRelationSN = false;
        }
        protected override void CreateBusinessLogic()
        {
            base.CreateBusinessLogic();
            _unloadProcess = new UnloadWithoutLoad(_data);
        }
        protected override ACCDevice CreateDevice()
        {
            ACCDevice dev = base.CreateDevice();
            //if (kukaSiemensDev != null)
            //{
            //    kukaSiemensDev.DB190 = 800;
            //    kukaSiemensDev.DB190_Offset = 3000;
            //    kukaSiemensDev.DB192 = 80;
            //    kukaSiemensDev.DB192_PLC_Offset = 66;

            //    kukaSiemensDev.DB193 = 800;
            //    kukaSiemensDev.DB193_PLC_Offset = 3034;
            //    kukaSiemensDev.DB193_ACC_Offset = 3068;
            //    kukaSiemensDev.DB194 = 800;
            //    kukaSiemensDev.DB194_PLC_Offset = 3034;
            //    kukaSiemensDev.DB194_PLC_Data_Offset = 3270;

            //    kukaSiemensDev.BarcodeLength = 30;
            //    kukaSiemensDev.LoadBarcodeCount = 7;
            //    kukaSiemensDev.UnloadBarcodeCount = 7;
            //}

            return dev;

        }

        public override void ChangePartNo(RuningPartNo newpartno)
        {
            base.ChangePartNo(newpartno);

            if(newpartno != null)
            {
                //WIPUnit unit = ACC.Business.Process.UnitDataProcess.GetWIPUnit(_lineData, "21130015060009BJ0000329");

                //logger.Debug(unit == null ? "null " : unit.UnitSN);
                //ACC.Business.Process.UnitDataProcess.RemoveWIPUnitFromLineCache(_lineData.RunningData, unit);
            }
        }
        
       
    }
}